Ext.namespace("Issue.Main");

Issue.Main.tabIndex = {
	"totask" : 0,
	"tofeedback" : 1,
	"toaudit2" : 2,
	"closed2" : 3,
	"search" : 4
};
Issue.Main.tabs = [];

Issue.initUI = function() {
	var opentab = Utils.getParameter('opentab');
	if (!opentab) opentab = "totask";	
	// init tabs
	Issue.Main.tabs.push(new Issue.ToTask());
	Issue.Main.tabs.push(new Issue.ToFeedback());
	Issue.Main.tabs.push(new Issue.ToAudit2());
	Issue.Main.tabs.push(new Issue.Closed2());
	Issue.Main.tabs.push(new Issue.Search2());
	Issue.instance = new Ext.TabPanel({
		region: 'center',
		activeTab: Issue.Main.tabIndex[opentab],
		items: Issue.Main.tabs
	});
	
	var mainview = new Ext.Viewport({
        layout:'border',
        items:[Issue.instance]
    });
};

Ext.onReady(function(){
	Ext.QuickTips.init();
    Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
	Issue.initUI();
});

